package exteditapp.state;

import exteditapp.AppletIterator;
import exteditapp.FileDefault;
import exteditapp.action.ActionError;

/**
 * State - upload process (shows percentage progress)
 * @author Arturas Smorgun, arturas@smorgun.lt
 */
public class StateUploadingDone extends IState {

	/**
	 * Default constructor
	 * @param iterator is system iterator, which performs all actions
	 * @param file this is file, which state we will hold
	 */
	public StateUploadingDone(AppletIterator iterator, FileDefault file) {
		super(iterator, file);
	}
	public StateUploadingDone(AppletIterator iterator, FileDefault file, boolean doRegister){
		super(iterator, file, doRegister);
	}
	
	protected void start(){
		this.setAction(new ActionError());
	}
	
	/**
	 * Handlink of new state
	 */
	public boolean handle() {
		//TODO implement upload state handling
		if(this.getLifetime() == 3)
			this.file.setCurrentState(new StateWaiting(this.getIterator(), this.file));
		return false;
	}

}
